<?php 

include '../function.php';

$str = "sdfsdfsdf.sdfsdfsdf";

$preg = "/\./";

$c = preg_match($preg, $str);

// var_dump($c);


// $str ="1.jpg@2.jpg@3.jpg#4.jpg";
// $preg="/(jp)g/";
// $c = preg_match($preg,$str);  
// var_dump($c);



$str = "学并思官网www.xuebingsiwang.com学并思论坛  http://bbs.xuebingsiwang.com我在学并思的网名叫xuebingsi";

// echo  $str ;
// echo "<br>";

$preg = "/xuebingsiwang/";


$newStr= preg_replace($preg,"<span  style='color:#f00'>xxxx</span>bbb",$str);


// echo $newStr;





// $str = "http://www.baidu.com不新浪网http://www.sina.com";
// $preg = "/\.(baidu|sina)\./";

// $new_str = preg_replace($preg,'.xuebingsiwang.',$str);
// echo $new_str;


$str = "werwer7584936h6khkujh";

$preg = "/[0-9]{7}/";

$c = preg_match($preg, $str);

// var_dump($c);


$str = "werwer6666khkujh";

// var_dump($str);

$preg = "/6{2,4}?/";

$c = preg_replace($preg,"77",$str);

// var_dump($c);


$str = "zhi867";

$preg = "/^[A-z][0-9A-z]{5,7}$/";
//6-8字符串，不能以数字开始，包含字母与数字。

$c = preg_match($preg, $str);

// var_dump($c);


$str = "18925139194";

$preg = "/^1[3578][0-9]{9}$/";

$c = preg_match($preg, $str);

// var_dump($c);


$str = "44528120161124187x";

$preg = "/^[1-9][0-9]{5}(19[0-9]{2}|20(0[0-9]|1[0-6]))(0[1-9]|1[0-2])([0][1-9]|[12][0-9]|3[0-1])[0-9]{3}[0-9x]$/";

$c = preg_match($preg, $str);

// var_dump($c);



$str = "Zhibin@qq.com.cn"; 

$preg = "/^[a-z0-9][a-z0-9_]*@([a-z0-9]+|[a-z0-9][a-z0-9-]+[a-z0-9])(\.[a-z]+)+$/i";

$c = preg_match($preg, $str);

// var_dump($c);



$str ="1.jpg@2.jpg@3.jpg#4.jpg";
$preg="/[@#]/";
$arr = preg_split($preg,$str);  
// var_dump($arr);



$str = "学并思官网www.xuebingsiwang.com";

$preg = "/([a-z]{9})wa(ng)/";


$c = preg_match_all($preg, $str, $out);

// var_dump($c);
// var_dump($out);

$temp = [];

for ($i=2576923; $i <0; $i++) { 

	$str = file_get_contents('https://www.lagou.com/jobs/'.$i.'.html');

	// sleep(2);

	$preg = "/<span class=\"name\">(.+)<\/span>/";


	$c = preg_match_all($preg, $str, $out);

	if($c){
		$temp[] = $out[1][0];
	}
}

// var_dump($temp);



	$str = file_get_contents('https://www.lagou.com/');

	// sleep(2);

	$preg = "/<a href=\"(.+)\" target=\"_blank\" class=\"position_link fl wordCut\"/";


	$c = preg_match_all($preg, $str, $out);

	// var_dump($c);
	// var_dump($out);



	$str = file_get_contents('https://www.lagou.com/');

	// sleep(2);

	$preg = "/<a href=\".+\" data-lg-tj-id=\".+\" data-lg-tj-no=\".+\" data-lg-tj-cid=\"idnull\" class=\".*\">(.+)<\/a>/";


	$c = preg_match_all($preg, $str, $out);

	var_dump($c);
	var_dump($out);

	file_put_contents('./db.php', var_export($out,true));









 ?>